package com.cai.activiti_demo1.listener;

import org.activiti.engine.delegate.DelegateTask;
import org.activiti.engine.delegate.TaskListener;

import java.util.Map;
import java.util.Set;

public class MySecondListener implements TaskListener {
    @Override
    public void notify(DelegateTask delegateTask) {
        //获取所有变量
        Map<String, Object> variables = delegateTask.getVariables();
        Set<String> keySet = variables.keySet();
        for (String s : keySet) {
            Object o = variables.get(s);
            System.out.println(s+" = "+o);
            //获取之后修改对应的流程变量信息
            delegateTask.setVariable(s,o+"[]");
        }
    }


}
